package com.example.design.shejimoshi.action.state.状态机实现方式三状态模式.inter;

import com.example.design.shejimoshi.action.state.enums.State;
import com.example.design.shejimoshi.action.state.状态机实现方式三状态模式.MarioStateMachine;

/**
 * @Description 斗篷马里奥
 * @date 2022/11/2 13:56
 * @Author liuzhihui
 * @Version 1.0
 */
public class CapeMario extends AbstractIMario {
    private MarioStateMachine marioStateMachine;

    public CapeMario(MarioStateMachine marioStateMachine) {
        this.marioStateMachine = marioStateMachine;
    }

    @Override
    public State getName() {
        return State.CAPE;
    }

    @Override
    public void obtainMonster() {
        marioStateMachine.setCurrentState(new SmallMario(marioStateMachine));
        marioStateMachine.setScore(marioStateMachine.getScore() - 200);
    }
}
